﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Job
/// </summary>
/// 
namespace Commercial
{
    public class Jobs
    {
        Up1VNDataContext db = new Up1VNDataContext();
        public Jobs()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public IList<Job> ListJob()
        {
            var query = db.Jobs.Where(x => x.active == 1).ToList();
            return query;
        }

        public Job DetailJob(int id)
        {
            var query = db.Jobs.Where(x => x.id == id && x.active == 1).FirstOrDefault();
            return query;
        }

        public Job DetailJob(string name)
        {
            var query = db.Jobs.Where(x => x.job_name == name && x.active == 1).FirstOrDefault();
            return query;
        }
    }
}